package com.ifengchao.job;

import com.ifengchao.commonUtil.ActionException;
import com.ifengchao.service.DealOrderService;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * 处理订单
 *
 * @author chen
 */
@Component(value = "dealOrderJob")
public class DealOrderJob {
    private static final Logger logger = Logger.getLogger(DealOrderJob.class);
    @Autowired(required = true)
    private DealOrderService dealOrderService;

    /**
     * 处理订单逻辑
     */
    public void executeTask() {
        System.out.println("-----进入订单处理job------");
        logger.info("-----进入订单处理job------");
        try {
            dealOrderService.dealAllPlan();
//			dealOrderService.queryAllOrder();
        } catch (ActionException e) {
            logger.error("订单处理出错：", e);
        }
    }
}